//package com.ruoyi.controller;
//
//import com.ruoyi.common.core.domain.entity.File;
//import com.ruoyi.system.service.FileService;
//import com.zhishiku.filesystem.util.MinioUtil;
//import io.minio.GetPresignedObjectUrlArgs;
//import io.minio.MinioClient;
//import io.minio.http.Method;
//import lombok.extern.slf4j.Slf4j;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.concurrent.TimeUnit;
//
//@Slf4j
//@RestController
//@RequestMapping("/api/files")
//public class OnlyOfficeController {
//
//
//    @Autowired
//    private MinioClient minioClient;
//
//    @Autowired
//    private FileService fileService;
//    @GetMapping("/files/{fileId}")
//    public ResponseEntity<File> getFileMeta(@PathVariable Long fileId) {
//        File meta = fileService.selectFileById(fileId);
//        String signedUrl = minioClient.getPresignedObjectUrl(
//                GetPresignedObjectUrlArgs.builder()
//                        .method(Method.GET)
//                        .bucket("documents")
//                        .object(meta.getFilePath())
//                        .expiry(7, TimeUnit.DAYS)
//                        .build()
//        );
//        meta.setFilePath(signedUrl);
//        return ResponseEntity.ok(meta);
//    }
//}
